package com.lcy;

import com.lcy.mapper.StudentMapper;
import com.lcy.model.Student;
import com.lcy.mybatis.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/1/16.
 */
public class Demo {
    @Test
    public void ok(){
        SqlSession ss = MyBatisUtil.getSqlSession();
        StudentMapper sm = ss.getMapper(StudentMapper.class);
        Map<String ,Object> m = new HashMap<String,Object>();
        m.put("name","张三");
        List<Student> lst = sm.search(m);
        for (Student s : lst){
            System.out.print(s.getName());
        }
        ss.commit();
        ss.close();
    }

}
